﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MainMaster.master" AutoEventWireup="true"
    CodeFile="postbuyleads.aspx.cs" Inherits="postbuyleads" %>

<%@ Register Src="UserControl/fore/UC_PostBuyleads.ascx" TagName="UC_PostBuyleads"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CssLinkHolder" runat="Server">
    <link href="Themes/css/jquery.selecter.css" rel="stylesheet" type="text/css" />
    <link href="themes/css/formValidator.css" type="text/css" rel="Stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="Server">
    <uc1:UC_PostBuyleads ID="UC_PostBuyleads1" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JsHolder" runat="Server">
    <script type="text/javascript" src="themes/scripts/formValidator-4.0.1.min.js"></script>
    <script type="text/javascript" src="Themes/scripts/jquery.selecter.js"></script>
    <script type="text/javascript" src="Themes/scripts/uploader.js"></script>
    <script type="text/javascript">


        $("#postFile").uploadFile({ key: '#viewImg', type: 4, val: "" });

        function uploadSuccess(fileEntity) {
            jQuery("#viewImg").find("img").attr("src", fileEntity.ImageUrl).show();
            jQuery("#hidfilepath").val(fileEntity.FileID + fileEntity.FileExtension);
        }



        jQuery(function () {

            jQuery("#selecter").selecter({
                handler: '/AjaxGet.ashx',
                data: 'cmd=2030&parentid=',
                isSingle: true
            });

            jQuery.formValidator.initConfig({ submitButtonID: "btnSubmit", autoTip: false, debug: false, onSuccess: function () { return true; }, onError: function () { } });

            jQuery("#txtEmail").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 1, onError: "Email is required" })
            .regexValidator({ regExp: "^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$", onError: "Email is not valid" });

            jQuery("#txtBuyleadsName").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 2, onError: "Buying Lead Title is required" });
            jQuery("#txtBuyleaderDetail").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 2, onError: "Detailed Description is required" });
            jQuery("#txtFirstName").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 2, onError: "First Name is required" });
            jQuery("#txtLastName").formValidator({ tipID: "txtFirstNameTip", onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 2, onError: "Last Name is required" });
            jQuery("#dropdownCountry").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 1, onError: "Country/Region is required" });
            jQuery("#hidcategory").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).functionValidator({ fun: function () {
                var vals = [];
                jQuery("#selected li").each(function (i, o) {
                    if (jQuery(o).attr("rel") != undefined) { vals.push(jQuery(o).attr("rel")); }
                })
                jQuery("#hidcategory").val(vals.join(","));


                return vals.length > 0;
            }, onError: "Category is required"
            });
            jQuery("#txtCode").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 4, max: 4, onError: "Verification Code is required" });
        })
    </script>
</asp:Content>
